home *** CD-ROM | disk | FTP | other *** search
/ Champak 145 / (Vol 145) Dec 21 2011.iso / Games / hearts.swf / scripts / DefineSprite_493 / frame_2 / DoAction.as
Encoding:
Text File  |  2011-12-21  |  1.4 KB  |  61 lines

  1. if(this._parent.mainDisplay.mode == "login")
  2. {
  3.    this._parent.updateGamesCompleted();
  4. }
  5. this.aF = this._parent.arrowsFired;
  6. this.hH = this._parent.heartsHit;
  7. this.fH = this._parent.fliesHit;
  8. trace("Arrows fired = " + this._parent.arrowsFired);
  9. trace("Misses = " + this._parent.misses);
  10. if(this._parent.arrowsFired != 0)
  11. {
  12.    this.acc = Math.round(100 * (this._parent.arrowsFired - this._parent.misses) / this._parent.arrowsFired);
  13. }
  14. else
  15. {
  16.    this.acc = 0;
  17. }
  18. if(this._parent.arrowsFired != 0 and this._parent.arrowsFired != this._parent.misses)
  19. {
  20.    this.aC = Math.ceil((this._parent.heartsHit + this._parent.fliesHit) / (this._parent.arrowsFired - this._parent.misses));
  21. }
  22. else
  23. {
  24.    this.aC = 0;
  25. }
  26. this.mC = this._parent.maxHits;
  27. this.mP = this._parent.maxPts;
  28. this.fS = this._parent.score;
  29. this.nameInst.onSetFocus = function()
  30. {
  31.    if(this.text == "Type your name here")
  32.    {
  33.       this.text = "";
  34.    }
  35. };
  36. this.acc += "%";
  37. this.nameInst.onSetFocus = function()
  38. {
  39.    if(this.text == "Enter Your Name")
  40.    {
  41.       this.text = "";
  42.    }
  43. };
  44. this.nameInst.onKillFocus = function()
  45. {
  46.    if(this.text == "")
  47.    {
  48.       this.text = "Enter Your Name";
  49.    }
  50. };
  51. this.sendScore = function()
  52. {
  53.    var t = this;
  54.    ab20_09 = new LoadVars();
  55.    ab20_09.z = t.nameInst.text;
  56.    ab20_09.x = t.fs;
  57.    ab20_09.c = 682;
  58.    ab20_09.v = "XMUSUF";
  59.    ab20_09.sendAndLoad("http://armorbot.com/s_b",ab20_09,"POST");
  60. };
  61.